package com.dfiov.cloud.msmtools.contant.msbluetooth;

public enum BluetoothKeyStatusEnum {
    CREATE("CREATE",0,"新建"),
    VALID("VALID",1,"使用中"),
    LOGOUT("LOGOUT",2,"已注销"),
    RETURNED("RETURNED",3,"已归还"),
    EXPIRED("EXPIRED",4,"已过期"),
    TEMPORARY_LOGOUT("TEMPORARY_LOGOUT",5,"临时注销"),
    TEMPORARY_RETURNED("TEMPORARY_RETURNED",6,"临时归还");
    private String key;
    private Integer value;
    private String info;

    public String getKey() {return this.key;}
    public Integer getValue() {return this.value;}
    public String getInfo() {return this.info;}

    BluetoothKeyStatusEnum(String key, Integer value, String info) {
        this.key = key;
        this.value = value;
        this.info = info;
    }

    public static BluetoothKeyStatusEnum getEnumByValue(Integer value) {
        for(BluetoothKeyStatusEnum bluetoothKeyStatusEnum : BluetoothKeyStatusEnum.values()) {
            if(bluetoothKeyStatusEnum.getValue().equals(value)) {
                return bluetoothKeyStatusEnum;
            }
        }
        return null;
    }

    public static String getInfoByValue(Integer value) {
        BluetoothKeyStatusEnum bluetoothKeyStatusEnum = getEnumByValue(value);
        if(bluetoothKeyStatusEnum == null) {
            return null;
        }
        return bluetoothKeyStatusEnum.getInfo();
    }
}
